/*
 * MySQL Cluster SNMP monitoring subagent
 * Copyright (C) 2011, Steven Ayre <steveayre@gmail.com>
 *
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is MySQL Cluster SNMP monitoring subagent
 *
 * The Initial Developer of the Original Code is
 * Steven Ayre <steveayre@gmail.com>
 * Portions created by the Initial Developer are Copyright (C)
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Steven Ayre <steveayre@gmail.com>
 *
 * thread.h -- Thread helper header
 *
 */

#ifndef __THREAD_H__
#define __THREAD_H__

typedef struct _thread thread_t;

thread_t* thread_start(const char *name, int (*thread_main) (thread_t*,void*), void *param);
void thread_stop(thread_t *thread);
void thread_destroy(thread_t *thread);

int thread_running(thread_t *thread);

void thread_yield(thread_t *thread, int usec);

int thread_exit_status(thread_t *thread);

const char* thread_name(thread_t *thread);

#endif

